package com.slkj.shilixiaoyuanapp.entity.code;

import android.content.res.Resources;

import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.SlxyApplication;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.OutWork.AplyyOutWorkActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.PunchClock.PunchClockActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.association.AssociationActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.goods.AplyyGoodsActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.homework.AssignmentActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.leave.AplyyLeaveActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.meeting.ApplyMeetingActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.notice.SendNoticeActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.officialSeal.ApplyOfficialSealActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.reimbursement.ApplyReimbursementActivity;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.repair.AplyyRepairActivity;

import java.util.HashMap;

/**
 * Created  on 2018-07-26
 *
 * @author 唐开阔
 * @describe 不同工具对应的code值
 */
public class  ToolCode {

    public static final int TOOL_BZZY = 1001;
    public static final int TOOL_XSKQ = 1002;
    public static final int TOOL_JLJC = 1003;
    public static final int TOOL_WSJC = 1004;
    public static final int TOOL_DKJ = 1005;
    public static final int TOOL_FBTZ = 1006;
    public static final int TOOL_CLSH = 1007;

    public static final int TOOL_WDSP = 1000;

    public static final int TOOL_JSKQ = 1008;
    public static final int TOOL_WPLY = 1009;
    public static final int TOOL_CG = 1010;
    public static final int TOOL_BIAOXIAO = 1011;
    public static final int TOOL_CC = 1012;
    public static final int TOOL_QJ = 1013;
    public static final int TOOL_YT = 1014;
    public static final int TOOL_GZ = 1015;
    public static final int TOOL_BX = 1016;

    public static final int TOOL_STHD= 1017;
    public static final int TOOL_XYBWG = 1018;

    public static final int P_TOOL_TYTC = 21020;//体艺特长
    public static final int P_TOOL_XSQJ = 21021;//学生请假
    public static final int P_TOOL_XYHD = 21022;//校外活动



    static String[] oneTools;
    static int[] oneImgs = {R.drawable.tool_homework,R.drawable.tool_attendance,R.drawable.tool_discipline,R.drawable.tool_brush,R.drawable.tool_swing,R.drawable.tool_paperplane,R.drawable.tool_approval };
    static Class[] oneToolsActivitys = {AssignmentActivity.class,AssignmentActivity.class,AssignmentActivity.class,AssignmentActivity.class,AssignmentActivity.class,SendNoticeActivity.class,SendNoticeActivity.class};
    static String[] twoTools;
    static  int[] twoImgs = {R.drawable.tool_approval,R.drawable.tool_clockin,R.drawable.tool_stationery,R.drawable.tool_purchase,R.drawable.tool_bill,R.drawable.tool_plane,R.drawable.tool_vacation,R.drawable.tool_meeting,R.drawable.tool_cachet,R.drawable.tool_bx };
    static  Class[] twoToolsActivitys = {PunchClockActivity.class,PunchClockActivity.class,AplyyGoodsActivity.class,AssignmentActivity.class,ApplyReimbursementActivity.class,AplyyOutWorkActivity.class,AplyyLeaveActivity.class,ApplyMeetingActivity.class,ApplyOfficialSealActivity.class,AplyyRepairActivity.class};
    static String[] threeTools;
    static int[] threeImgs = {R.drawable.tool_bicycle,R.drawable.tool_museum};
    static  Class[] threeToolsActivitys = {AssociationActivity.class,AssignmentActivity.class};
    static  HashMap<Integer,ToolInfo> hashMap = new HashMap<>();
    static {
        Resources res = SlxyApplication.getContext().getResources();
        oneTools = res.getStringArray(R.array.main_tool_level1);
        twoTools = res.getStringArray(R.array.main_tool_level2);
        threeTools = res.getStringArray(R.array.main_tool_level3);
        for (int i = 0; i < oneTools.length; i++) {
            hashMap.put(1001+i,new ToolInfo(1001+i,oneTools[i],oneToolsActivitys[i],oneImgs[i]));
        }
        for (int i = 0; i < twoTools.length; i++) {
            if (i == 0){
                hashMap.put(1000, new ToolInfo(1000, twoTools[i], twoToolsActivitys[i], twoImgs[i]));

            }else {
                hashMap.put(1007 + i, new ToolInfo(1007 + i, twoTools[i], twoToolsActivitys[i], twoImgs[i]));
            }
        }
        for (int i = 0; i < threeTools.length; i++) {
            hashMap.put(1017+i,new ToolInfo(1016+i,threeTools[i],threeToolsActivitys[i],threeImgs[i]));
        }
    }

    public static ToolInfo getToolData(int code){
        return   hashMap.get(code);
    }

    public static class ToolInfo{
        private String name;
        private int res;
        private int code;

        private Class activityClass;

        public ToolInfo( int code,String name, Class activityClass, int res) {
            this.name = name;
            this.res = res;
            this.code = code;
            this.activityClass = activityClass;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getRes() {
            return res;
        }

        public void setRes(int res) {
            this.res = res;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public Class getActivityClass() {
            return activityClass;
        }

        public void setActivityClass(Class activityClass) {
            this.activityClass = activityClass;
        }
    }


}
